package com.example.graalvm.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class GraalvmController {

    @Value("${server.port}")
    String port;

    /**
     *  读取配置中心属性
     */
    @Value("${foo:默认值}")
    String foo;

    @GetMapping("/started/hi")
    public String hi(@RequestParam String name) {
        String hi = "hi " + name + ",i am from port:" + port + ", config:" + foo;
        log.info("/hi服务：{}", hi);
        return hi;
    }
}
